<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
		<meta charset="UTF-8">
		<title>购物车</title>
		<link rel="stylesheet" type="text/css" href="Resources/css/shopCar_content.css">
		<link rel="stylesheet" type="text/css" href="Resources/layui/css/layui.css">
		<script type="text/javascript" src="Resources/layui/layui.js"></script>
		<script type="text/javascript" src="Resources/js/check.js"></script>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
	</head>

	<body>
		<div class="content content-nav-base shopcart-content">
			<div class="cart w1200">
				<div class="cart-table-th">
					<div class="th th-chk">
						<div class="select-all">
							<div class="cart-checkbox">
								<input class="check-all check" id="checkAll" name="checkAll" type="checkbox" onclick="selectAll();">
							</div>
							<label>&nbsp;&nbsp;全选</label>
						</div>
					</div>

					<div class="th th-chk-over"">
						<div class="select-all">
							<div class="cart-checkbox">
								<input class="check-over check" id="recheck" type="checkbox" onclick="notSelectAll();">
							</div>
							<label>&nbsp;&nbsp;反选</label>
						</div>
					</div>

					<div class="th th-item">
						<div class="th-inner">
							商品
						</div>
					</div>
					<div class="th th-price">
						<div class="th-inner">
							单价
						</div>
					</div>
					<div class="th th-amount">
						<div class="th-inner">
							数量
						</div>
					</div>
					<div class="th th-sum">
						<div class="th-inner">
							小计
						</div>
					</div>
					<div class="th th-op">
						<div class="th-inner">
							操作
						</div>
					</div>
				</div>
				
				<div class="OrderList">
					<div class="order-content" id="list-cont">
					
					<!-- 每一栏数据 -->
					<c:forEach items="${orderitem}" var="order" varStatus="st">
					
						<ul class="item-content layui-clear">
							<li class="th th-chk">
								<div class="select-all">
									<div class="cart-checkbox">
										<input class="CheckBoxShop check" id="" type="checkbox" name="child" value="${order.good.gid}" onclick="chickchild();">
									</div>
								</div>
							</li>
							<li class="th th-chk-over">
								<div class="select-all">
									<div class="cart-checkbox">
									<p>&nbsp;</p>
									</div>
								</div>
							</li>
							<li class="th th-item">
								<div class="item-cont">
									<a href="javascript:;"><img src="${order.good.gsrc }" alt=""></a>
									<div class="text">
										<div class="title">${order.good.gName }</div>
									</div>
								</div>
							</li>
							<li class="th th-price">
								<span class="th-su">￥${order.good.gPrice}</span>
							</li>
							<li class="th th-amount">
								<div class="box-btn layui-clear">
									<div class="less layui-btn" onclick="location.href='listOrderItem?status=update&num=red&oid=${order.good.gid}'">-</div>
									<input class="Quantity-input" type="text" name="num" value="${order.oNum}" disabled="disabled">
									<div class="add layui-btn" onclick="location.href='listOrderItem?status=update&num=add&oid=${order.good.gid}'">+</div>
								</div>
							</li>
							<li class="th th-sum">
								<span class="sum">￥${order.oNum*order.good.gPrice}</span>
							</li>
							<li class="th th-op">
								<span class="dele-btn"><a href="listOrderItem?status=delete&&id=${order.good.gid}">删除</a></span>
							</li>
						</ul>
					</c:forEach>
						
					</div>
				</div>

				<div class="FloatBarHolder layui-clear">
					<div class="th th-chk">
						<div class="select-all">
							<label>&nbsp;&nbsp;已选<span class="Selected-pieces">0</span>件</label>
						</div>
					</div>
					<div class="th batch-deletion">
						<span class="batch-dele-btn"><a href="#"  onclick="deleteall('listOrderItem?status=deletequery&ids=');">批量删除</a></span>
					</div>
					<div class="th Settlement">
						<button class="layui-btn" onclick="location.href='listOrderItem?status=submit&userid=${uid}';"">结算</button>
					</div>
					<div class="th total">
						<p>应付：<span class="pieces-total">${sum }</span></p>
					</div>
				</div>
			</div>
		</div>

	</body>
	<script type="text/javascript">
		layui.config({
			base: 'Resources/js/' //你存放新模块的目录，注意，不是layui的模块目录
		}).use(['mm', 'jquery', 'element', 'car'], function() {
			var mm = layui.mm,
				$ = layui.$,
				element = layui.element,
				car = layui.car;
			car.init()

		});
	</script>
</body>
</html>